These commands control whether a button is active or not. Buttons include plain buttons, invisible buttons, highlight buttons, check boxes and radio buttons. Do not use these commands on buttons that are controlled by automatic actions (except for the Delete Record action).
ENABLE BUTTON enables button, a button that was previously disabled with DISABLE BUTTON.
DISABLE BUTTON disables (dims) button, making it grey and un-selectable. You use DISABLE BUTTON to prevent a button from being used. A button should be disabled when the action that it causes would be inappropriate.
Buttons are enabled by default. You cannot use the ENABLE BUTTON or DISABLE BUTTON commands on automatic buttons; these are managed by 4th DIMENSION. A button can be disabled only with DISABLE BUTTON or by 4th DIMENSION when using automatic button actions. A button is disabled only while the layout is displayed; it must be disabled each time the layout is displayed. The button is disabled or enabled for the layout in the current process only.
The following example is the script of a search button located in the footer area of an output layout displayed using MODIFIED SELECTION. searches a file and enables or disables a button labeled Delete, depending on the results of the search:
SEARCH ([People]; [People]Name = vName) ` Find people to delete
Case of
: (Records in selection ([People]) = 0) ` No people found
BUTTON TEXT (bDelete; "Delete")
DISABLE BUTTON (bDelete)
: (Records in selection ([People]) = 1 ) ` One person found
BUTTON TEXT (bDelete; "Delete Person")
ENABLE BUTTON (bDelete)
: (Records in selection([People]), 1 ) ` Many people found
BUTTON TEXT (bDelete; "Delete People")
ENABLE BUTTON (bDelete)
End case
See also: BUTTON TEXT, Records in selection,  SEARCH